package com.epalmpay.service.management.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.epalmpay.entity.Button;
import com.epalmpay.mapper.ButtonMapper;
import com.epalmpay.service.management.IButtonService;

@Service("buttonService") 
public class ButtonServiceImpl implements IButtonService {
	
	
	@Resource  
    private ButtonMapper buttonMapper;

	
	public List<Button> listButtonsName(String userName) throws Exception {
		// TODO Auto-generated method stub
		return buttonMapper.listButtonsName(userName);
	} 

	
	public List<Button> AlllistButtonsName() throws Exception {
		return buttonMapper.selectAll();
	}


	public void save(Button pd) throws Exception {
		buttonMapper.insert(pd);
	}


	public void delete(String fhbuttonId) throws Exception {
		buttonMapper.deleteByPrimaryKey(fhbuttonId);
		
	}

	public void edit(Button pd) throws Exception {
		buttonMapper.updateByPrimaryKey(pd);
		
	}


	public List<Button> list(Button button) throws Exception {
		// TODO Auto-generated method stub
		return buttonMapper.ButtonlistPage(button);
	}

	public List<Button> listAll() throws Exception {
		// TODO Auto-generated method stub
		return buttonMapper.selectAll();
	} 

	public Button findById(String fhbuttonId) throws Exception {
		// TODO Auto-generated method stub
		return buttonMapper.selectByPrimaryKey(fhbuttonId);
	}
}
